<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<mesoBoard.Data.User>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<fieldset>
    <legend><%= Html.ThemeImage("roles.png") %> Members List</legend>
    
    <table class="form_table">
        <%  string selectedLetter = (string)ViewData["letter"]; %>
        <tr>
            <th style="padding: 0"><%= Html.ActionLink("(All)", "MembersList", "Members", null, new { @class = "memberlist-letter" + (selectedLetter == "(All)" ? " memberlist-selected-letter" : "") })%></th>
          <%  char alphaStart = Char.Parse("A");
              char alphaEnd = Char.Parse("Z");
              for (char i = alphaStart; i <= alphaEnd; i++)
              { %>
            <th style="padding: 0"><%= Html.ActionLink(i.ToString(), "MembersList", new { Letter = i.ToString() }, new { @class="memberlist-letter" + (selectedLetter == i.ToString() ? " memberlist-selected-letter" : "") })%></th>
          <%  } %>
        </tr>
    
    </table>
    
    <%= Html.Spacer(10) %>
    
    <table class="form_table">
        <tr>
            <th>Username</th>
            <th>Joined</th>
            <th>Posts</th>
            <th>Date of Birth</th>
        </tr>
        
        <% foreach(User u in Model){ %>
        
        <tr>
            <td><%= Html.UsernameLink(u) %></td>
            <td><%= u.RegisterDate.ToShortDateString() %> (<%= Html.RelativeDate(u.RegisterDate) %>)</td>
            <td><%= u.TotalPosts %></td>
            <td><%= u.UserProfile.Birthdate.HasValue ? u.UserProfile.Birthdate.Value.ToShortDateString() : "Not set" %></td>
        </tr>
        
        <%} %>       
    </table>
    
    <div style="margin-top: 5px;">
        <% Html.RenderPartial("Paging", ViewData["Paging"]); %>
    </div>
    
</fieldset>

</asp:Content>
